#ifndef _SEC_COMMON_H_
#define _SEC_COMMON_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <semaphore.h>

#include <openssl/aes.h>
#include <openssl/ossl_typ.h>
#include <openssl/evp.h>

#define spd_dbg printf

//#define debug noprintf
#define debug printf
//#define tlog	noprintf
#define tlog	printf

//#define errout noprintf
#define errout fprintf_error


#define MAX_SEM_CNT	10000

#define TLOG_CNT 10

FILE *erroutfd;

struct usem_st{
	sem_t *sem;
	char sname[32];
};

extern struct usem_st *usem;
extern struct usem_st *dsem;

extern unsigned char *endian_change(unsigned char *in,int len);

extern unsigned char *bin2s(unsigned char *b,unsigned char *s,int len);

extern int sha1_test();
extern int sha0_test();
extern int md5_test();
extern endin_test();
extern void set_rand_mem(unsigned char *ptr,unsigned size);

#define DATA_VIEW

#endif
